export type State = {
    locale?: string;
};

type Mutation = {
    type: string;
    payload: any;
}

const state: State = {
    locale: 'zh',
};

const reducer = (localeState: State = state, mutation: Mutation): State => {
    switch (mutation.type) {
    case 'SET_LOCALE': return {
        ...localeState,
        locale: mutation.payload,
    }; break;
    default: return localeState;
    }
};

export default reducer;
